The Navigator object contains basic information about the Web browser (such as name, version, operating system, etc.)
You can refer to the object by Window.navigator and use its properties to read the client base information
5 Main properties of
Browser
First, detect the name of the browserProblem:The standard support for JavaScript is different for different browsers, and sometimes you want the script to work well on different browsers, and then you need to detect the browser, determine
Javascript| Browser
First, detect the name of the browserProblem:The standard support for JavaScript is different for different browsers, and sometimes you want the script to work well on different browsers, and then you need to detect the browser,
Detect in 360 browser Output to mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;. NET CLR trident/4.0; inf opath.2; asktbptv/5.17.0.25589; Alexa toolbar) Detect display as mozilla/5.0 (Windows NT 5.1; rv:38.0) gecko/20100101 firefox/38.
Javascript: use JavaScript to detect browser-related features. Javascript tutorial
I. Check the browser nameProblem:Different browsers have different standard support for javascript. Sometimes you want the script to run well on different browsers.
Ajax| Browser
AJAX Hacks HACK1. To detect browser compatibility This section describes how to use JavaScript to establish a corresponding request object for IE or Mozilla browsers. The browsers used by the client are various. Therefore, there are
In the writing Cross-browser JS program, the detection browser is a very important work. We occasionally write branch codes for different browsers.The following is a:
Copy Code code as follows:
Add Event Tool function
function
First, introduce the next 5 kinds of original types
5 of the original types in JavaScript are string, Number,boolean,undefined,null
var name = "Jack";
var age =;
var single = false;
var app; Undefined
Console.log (typeof name);
The role of the object, so all variables/functions declared in the global scope become properties and methods of the Window object;/PS: Attempting to access an undeclared variable throws an error, but by querying the Window object, you can know if
Some js Code, spare by yourself, master do not laugh at me. (Cross-browser basic events, browser detection, and judgment of the browser name, version number, and operating system) are very practical and convenient for your use. Interested friends
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.